Page({
  editHouse() {
    // 跳转的时候需要携带当前页面的id参数
    wx.navigateTo({
      url: "/house_pkg/pages/form/index?id=" + this.data.houseDetail.id,
    });
  },
  data: {
    houseDetail: {},
  },
  onLoad({ id }) {
    this.getDetail(id);
  },

  async getDetail(id) {
    const { code, data } = await wx.http.get(`/room/${id}`);
    if (code !== 10000) return wx.utils.toast();
    this.setData({
      houseDetail: data,
    });
  },
});
